Development of a DC/DC converter for a LED system using Simulink
Copyright 2020 - 2023 The MathWorks, Inc.
Before starting
If you get warning such as this one:
do not panic! It simply means that you don't have the newly released C2000 Microcontroller Blockset. If it is not present in your installation, reach out to MathWorks to organize a trial. This blockset is only needed for deployment and code generation. You can still uses models and scripts for the simulation and tuning part - the configuration parameter for hardware implementation is set automatically to "None". Webinar recording link
Full version, 54 minutes:
Application description
This workflow reference covers the design, analysis, and software development for a Single Ended Primary Inductor Converter, commonly known as SEPIC, which is powered by a 12 Volt lithium-ion battery and is converting voltage to 18 Volt to power 36 LEDs divided in 6 module with each 6 LEDs in series. The developed software include a simplified BMS (battery management system) to watch over the battery status, supervisory logic to coordinate mode of operation and two closed-loop controllers (SEPIC voltage and LEDs current).
Software & Skills Requirements
This is an end-to-end workflow that encompass the role of multiple people. In reality, not everybody in a team would need all the toolboxes. Please contact your local MathWorks office to discuss and scope out toolchain needs.
To fully profit of this reference workflow you would need following products in release R2023b:
- Modeling and design environment: MATLAB, Simulink, Stateflow, Simscape, Simscape Electrical, Signal Processing Toolbox, DSP Systems Toolbox, Fixed-Point Designer
- Testing and tuning: Simulink Test, Control System Toolbox, Simulink Control Design, System Identification Toolbox
- Requirements, Verification and Validation: Requirements Toolbox, Simulink Coverage
- Automatic Code Generation and Implementation: MATLAB Coder, Simulink Coder, Embedded Coder, C2000 Microcontroller Blockset, Compatible C code compiler,
A prerequisite to fully profit from this reference workflow is to take following four onramps (starting from release R2020b):
The onramps are interactive, self-paced training (around 2 hours length). In addition, particularly for professionals, it is really beneficial to attend following (paid) trainings relevant to this topic:
Components
This project has been deveoped around a Texas instrument LED kit (codename: TMDSDCDCLEDKIT (link to online reference guide)). It uses a F28069 ControlCard.
The reference workflow doesn't need an hardware board for the majority of the discussed topics.
This application is interesting because:
- The SEPIC is using medium to high switching frequency (100 kHz)
- LEDs are current controlled using 20 kHz switching. Going from some LEDS working to only one or zero cause the SEPIC to go from CCM (continuous current mode) to DCM (discontinuous current mode)
- Filter design plays an important role in getting current and voltage signals as proper inputs to the controllers
System in action
You can see in the top left corner the hardware working. On the right top corner there is the model where we pressed once "deploy to hardware" to automatically generate code and load it unto the hardware kit.
Bottom left we see the current of the LEDs (which are powered on and off randomly) regulated to 60 mA. Bottom right corner the voltage is kept at 18 Volt, although you can see spikes when the LED change rapidly status.
Both controllers are PI controllers which were modeled, simulated tuned and verified within the Simulink platform. Because the converter was modeled appropriately, the PI parameters derived in simulation can be used directly on hardware with good results.
Workflow
This demo covers a typical power electronics development workflow, divided in 6 sections. Specific shortcuts based on these sections exist in the Project Shortcuts of the Simulink Project.